credit2: during scheduling, update the idle mask before using it
authorDario Faggioli <dfaggioli@suse.com>
Thu, 22 Nov 2018 11:54:56 +0000 (11:54 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Thu, 22 Nov 2018 11:54:56 +0000 (11:54 +0000)
commita9400d630b341da544ff355405db779356fe8807
treedbc67573395c22e683f5e434ac65bb72df2d1d4b
parent568653e01b84be5ac15fbf949bbcffcd91d6e829
credit2: during scheduling, update the idle mask before using it

Load balancing, when happening, at the end of a "scheduler epoch", can
trigger vcpu migration, which in its turn may call runq_tickle(). If the
cpu where this happens was idle, but we're now going to schedule a vcpu
on it, let's update the runq's idle cpus mask accordingly _before_ doing
load balancing.

Not doing that, in fact, may cause runq_tickle() to think that the cpu
is still idle, and tickle it to go pick up a vcpu from the runqueue,
which might be wrong/unideal.

Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit2.c